package com.itqf.controller;

import com.itqf.bean.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * projectName: springmvc2103
 *
 * @author: 赵伟风
 * time: 2021/7/5 14:18
 * description: 跨域问题
 */
@RestController
@RequestMapping("index")
//@CrossOrigin("*")
public class IndexController {


    @GetMapping("hello")
    public Object hello(){
        User user = new User();
        user.setAccount("root");
        user.setPassword("root");
        user.setName("孔二狗");
        System.out.println("IndexController.hello");
        int i= 1/0;
      return user;
    }


    @GetMapping("hello1")
    public Object hello1(){
        System.out.println("IndexController.hello1");
        User user = null ;
        user.setAccount("root");
        user.setPassword("root");
        user.setName("孔二狗");

        return user;
    }




}
